$OpenBSD: patch-configure_ac,v 1.20 2017/02/25 11:17:30 ajacoutot Exp $
--- configure.ac.orig	Tue Feb 21 06:13:13 2017
+++ configure.ac	Thu Feb 23 19:12:00 2017
@@ -819,9 +819,7 @@ AC_ARG_ENABLE([optimizations],
               [AS_HELP_STRING([--disable-optimizations], [Don't try to guess what optimization to enable])],
               [], [test x"$enable_debug" != x"no" && enable_optimizations="no"])
 AM_CONDITIONAL([DISABLE_OPTIMIZATIONS], [test x"$enable_optimizations" = x"no"])
-if test x"$enable_optimizations" = x"no"; then
-    DEFAULT_OCFLAGS='$(O0_CFLAGS)'
-else
+if test x"$enable_optimizations" = x"yes"; then
     dnl For multi-pass compilation: never when cross-compiling
     if test x"$cross_compiling" != x"yes"; then
         if test x"$GCC" = x"yes"; then
@@ -845,7 +843,7 @@ AC_SUBST(O3_CFLAGS)
 AC_SUBST(PASS1_CFLAGS)
 AC_SUBST(PASS2_CFLAGS)
 
-test x"$DEFAULT_OCFLAGS" = x"" && DEFAULT_OCFLAGS='$(O3_CFLAGS)'
+test x"$DEFAULT_OCFLAGS" = x"" && DEFAULT_OCFLAGS=''
 AC_SUBST(DEFAULT_OCFLAGS)
 
 if test x"$arch_x86" != x"no" && test x"$enable_macosx_universal" = x"no"; then
@@ -1000,9 +998,9 @@ t q
 b
 :q
 q"
-x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.$acl_cv_shlibext"* "${x_libraries:-/usr/lib}/libX11.$acl_cv_shlibext"* 2>/dev/null | sed -e \"${soname_script}\"`"
+x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.$acl_cv_shlibext"* "${x_libraries:-/usr/lib}/libX11.$acl_cv_shlibext"* 2>/dev/null | sed 1q`"
 AC_DEFINE_UNQUOTED([LIBX11_SO], "${x_lib_location:-libX11.$acl_cv_shlibext}", [The soname of libX11, needed for dlopen()])
-x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.$acl_cv_shlibext"*  "${x_libraries:-/usr/lib}/libXv.$acl_cv_shlibext"*  2>/dev/null | sed -e \"${soname_script}\"`"
+x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.$acl_cv_shlibext"*  "${x_libraries:-/usr/lib}/libXv.$acl_cv_shlibext"*  2>/dev/null | sed 1q`"
 AC_DEFINE_UNQUOTED([LIBXV_SO],  "${x_lib_location:-libXv.$acl_cv_shlibext}",  [The soname of libXv, needed for dlopen()])
 
 dnl Does X11 need XLockDisplay () to prevent deadlocks?
